% Produced by CVXGEN, 2014-05-20 16:06:21 -0400.
% CVXGEN is Copyright (C) 2006-2012 Jacob Mattingley, jem@cvxgen.com.
% The code in this file is Copyright (C) 2006-2012 Jacob Mattingley.
% CVXGEN, or solvers produced by CVXGEN, cannot be used for commercial
% applications without prior written permission from Jacob Mattingley.

% Filename: cvxsolve.m.
% Description: Solution file, via cvx, for use with sample.m.
function [vars, status] = cvxsolve(params, settings)
Y = params.Y;
cvx_begin
  % Caution: automatically generated by cvxgen. May be incorrect.
  variable v(3, 1);
  variable w(8, 1);
  w >= 0;

  minimize(sum(square(v)));
  subject to
    Y*w == v;
    sum(w) == 1;
cvx_end
vars.v = v;
vars.w = w;
status.cvx_status = cvx_status;
% Provide a drop-in replacement for csolve.
status.optval = cvx_optval;
status.converged = strcmp(cvx_status, 'Solved');
